<%--
 *  File:    DEREdit.jsp
 *  @Author: Langerwang
 *  Date:    2001/11/4
 *
 *  Copyright (C) 2000 - 2001 Oval Technologies, Inc.
 *  All rights reserved.
 *
 *  This software is the confidential and proprietary information of Oval
 *  Technologies, Inc. ("Confidential Information").  You shall not
 *  disclose such Confidential Information and shall use it only in
 *  accordance with the terms of the license agreement you entered into
 *  with Oval.
--%>

<%@ include file="/inc/SessionTimeout.inc"%>
<%@ page language="java" %>
<%@ page import="java.util.*" %>
<%@ page import="org.apache.log4j.Category" %>

<%@ page contentType = "text/html;charset=UTF-8" %>
<%@ taglib uri="/WEB-INF/PageFlow.tld" prefix="PageFlow" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/custom.tld" prefix="custom" %>


<%
  String strModuleName = "ERM";
  String privilegeCode = "10301";
  HashMap userInfo = (HashMap)session.getAttribute("userinfo");
%>
<% //--------------------------------------  include files list --%>
<%@ include file="/inc/Security.inc" %>
<%@ include file="/inc/PageDefault.inc" %>

<html>
<head>
<title>eredit</title>
<PageFlow:CheckPageFlow pageName="eredit"/>
<%
  HashMap relationinfo = (HashMap)pageContext.getAttribute("relationinfo");
  if(relationinfo == null)
    relationinfo = new HashMap();

  Vector allbusiarea = (Vector)pageContext.getAttribute("allbusiarea");
  if(allbusiarea == null)
    allbusiarea = new Vector();
  Vector allorggroup = (Vector)pageContext.getAttribute("allorggroup");
  if(allorggroup == null)
    allorggroup = new Vector();
  Vector allcreditlevel = (Vector)pageContext.getAttribute("allcreditlevel");
  if(allcreditlevel == null)
    allcreditlevel = new Vector();
  Vector allsales = (Vector)pageContext.getAttribute("allsales");
  if(allsales == null)
    allsales = new Vector();
 
  String strcolor=new String("#000000");
  String strreadonly=new String("readonly=true");
  if(relationinfo.get("ratetype")!=null){
  int iratetype=((Integer)relationinfo.get("ratetype")).intValue();
  if (iratetype==1){
    strcolor="#FF0000";
    strreadonly="";
    }
  }

  String IsExternal = "";
	String RelationType = "";
	String IsEdit = "";

	IsExternal = (String)session.getAttribute("IsExternal");
	if (IsExternal == null)
		IsExternal="";

	 if (request.getParameter("globalpccode")!=null)
	      RelationType = request.getParameter("globalpccode").toString();
	 if (pageContext.getAttribute("relationtype1")!=null)
	      RelationType = pageContext.getAttribute("relationtype1").toString();
	 else if  (RelationType == null)
	      RelationType="";

	IsEdit = (String)pageContext.getAttribute("IsEdit");
	if (IsEdit == null)
		IsEdit="";
String isnew="no";
if(session.getAttribute("isnew")!=null){

isnew = (String)session.getAttribute("isnew");
}

%>

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="../../css/<%= strLanguageCode %>/main.css" type="text/css">
<script language="JavaScript" src="../../js/ScriptLib.js"></script>
<%@ include file="/inc/NewCalendar.inc" %>
<script language="JavaScript">

	
window.onload=function page_onloads(){
	<%if(isnew.equals("yes")||isnew=="yes"){%>
	parent.up.page_onload()
<%}%>
}
function page_done()
{
	document.frm.isnew.value="yes";
	
  if(!checkForm(document.frm))  return;
  if(frm.ratetype.value == '1' && frm.zctcurrencycode.value==' ')
  {
    alert("<%= message.getMessageDesc("Can_not_be_null", label.getLabelName("L_CommonCurrency",false)) %>");
    frm.zctcurrencycode.focus();
    return;
  }
  formatDate(frm);
  emptyToNull(document.frm);
  frm.target="_self";
	frm.actionname.value = "done";

	frm.submit();
	
 
}

function currencychg()
{
  if(frm.ratetype.value == "1")
  {
   if(frm.zctcurrencycode.value=="<%=JspHelper.filterNull(userInfo.get("booksetcurrencycode"))%>")
    {
         frm.zctrate.value=1.0;
         frm.zctrate.readOnly=true;
    }
   else
    {
          frm.zctrate.readOnly=false;
    }
   }
}

function changeratetype()
{
   if(frm.ratetype.value == "1")
  {
   if(frm.zctcurrencycode.value=="<%=JspHelper.filterNull(userInfo.get("booksetcurrencycode"))%>")
    {
         frm.zctrate.value=1.0;
         frm.zctrate.readOnly=true;
    }
   else
    {
        frm.zctrate.readOnly=false;
    }
   ratespan.style.display="inline";
   frm.zctrate.command="notnull";
   }
  else
  {
   frm.zctrate.readOnly=true;
   frm.zctrate.value="";
   ratespan.style.display="none";
   frm.zctrate.command="nullable";
   }
}
function page_cancel()
{
  location.href = "Blank.jsp?<%= OvalTools.randomURL() %>";
}
function change_onceflag(type)
{
  if(type == 1)
  {
    if(frm.onceflag1.checked == true)
      frm.onceflag.value = "1";
    else
      frm.onceflag.value = "0";
  }
  else
  {
    if(frm.onceflag.value == "1")
      frm.onceflag1.checked = true;
    else
      frm.onceflag1.checked = false;
  }
}
function poporg(type,type2)
{
  if(type == "Y")
     if(type2 == 1)
         window.open("../ogm/OrgSelect.jsp?<%= OvalTools.randomURL() %>&selectoption=owner&languagecode=<%= strLanguageCode %>", "newwindow", "height=250, width=600,top=100,left=100,toolbar=no, menubar=no, scrollbars=yes, resizable=no, location=no, status=no");
     else
         window.open("../ogm/OrgSelect.jsp?<%= OvalTools.randomURL() %>&selectoption=notintree&languagecode=<%= strLanguageCode %>", "newwindow", "height=250, width=600,top=100,left=100,toolbar=no, menubar=no, scrollbars=yes, resizable=no, location=no, status=no");
  else
     if(type2 == 1)
         window.open("../ogm/OrgSelect.jsp?<%= OvalTools.randomURL() %>&selectoption=orgtree&languagecode=<%= strLanguageCode %>", "newwindow", "height=250, width=600,top=100,left=100,toolbar=no, menubar=no, scrollbars=yes, resizable=no, location=no, status=no");
     else
         window.open("../ogm/OrgSelect.jsp?<%= OvalTools.randomURL() %>&selectoption=intree&languagecode=<%= strLanguageCode %>", "newwindow", "height=250, width=600,top=100,left=100,toolbar=no, menubar=no, scrollbars=yes, resizable=no, location=no, status=no");
}
function page_setOrg(id,name,code)
{
  frm.ownerorgid.value = id;
  frm.sourceorgid.value = id;
  frm.sourceorgcode.value = code;
  frm.sourceorgname.value = name;
  changeSourceOrg();
}
function setClean1()
{
  frm.ownerorgid.value = "";
  frm.sourceorgid.value = "";
  frm.sourceorgcode.value = "";
  frm.sourceorgname.value = "";
}
function page_setOrg2(id,name,code)
{
  frm.targetorgid.value = id;
  frm.targetorgcode.value = code;
  frm.targetorgname.value = name;
<%--  page_summary("search");--%>
}
function setClean2()
{
  frm.targetorgid.value = "";
  frm.targetorgcode.value = "";
  frm.targetorgname.value = "";
}
function changeSourceOrg()
{
  frm.target="_self";
	frm.action = "DEREdit.jsp";
	frm.submit();
}
function changeOrg(type,type2,searchvalue)
{
if(type == "Y")
     if(type2 == 1)
         window.open("../ogm/OrgSelect.jsp?<%= OvalTools.randomURL() %>&selectoption=owner&searchname=orgcode&searchvalue=" + searchvalue + "&languagecode=<%= strLanguageCode %>", "newwindow", "height=250, width=600,top=100,left=100,toolbar=no, menubar=no, scrollbars=yes, resizable=no, location=no, status=no");
     else
         window.open("../ogm/OrgSelect.jsp?<%= OvalTools.randomURL() %>&selectoption=notintree&searchname=orgcode&searchvalue=" + searchvalue + "&languagecode=<%= strLanguageCode %>", "newwindow", "height=250, width=600,top=100,left=100,toolbar=no, menubar=no, scrollbars=yes, resizable=no, location=no, status=no");
  else
     if(type2 == 1)
         window.open("../ogm/OrgSelect.jsp?<%= OvalTools.randomURL() %>&selectoption=orgtree&searchname=orgcode&searchvalue=" + searchvalue + "&languagecode=<%= strLanguageCode %>", "newwindow", "height=250, width=600,top=100,left=100,toolbar=no, menubar=no, scrollbars=yes, resizable=no, location=no, status=no");
     else
         window.open("../ogm/OrgSelect.jsp?<%= OvalTools.randomURL() %>&selectoption=intree&searchname=orgcode&searchvalue=" + searchvalue + "&languagecode=<%= strLanguageCode %>", "newwindow", "height=250, width=600,top=100,left=100,toolbar=no, menubar=no, scrollbars=yes, resizable=no, location=no, status=no");
}
//frm.IsExternal.value = top.isExternal;
//frm.RelationType.value = top.relationType1;
</script>
</head>

<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<form name="frm" method="post" action="../../Dispatcher" target="_parent">
  <input type="hidden" name="pagename" value="eredit">
  <input type="hidden" name="actionname">
  <input type="hidden" name="datelastupdated" value="<%=JspHelper.filterNull( new java.sql.Date(new java.util.Date().getTime()) )%>">
  <input type="hidden" name="orgrelationdetailid" value="<%=JspHelper.filterNull( relationinfo.get("orgrelationdetailid") )%>">
  <input type="hidden" name="relationid" value="<%=JspHelper.filterNull( relationinfo.get("relationid") )%>">
  <input type="hidden" name="orgid" value="<%=JspHelper.filterNull( pageContext.getAttribute("orgid") )%>">
  <input type="hidden" name="IsEdit" value="<%=JspHelper.filterNull(IsEdit)%>">
  <input type="hidden" name="sourceorgid" value="<%=JspHelper.filterNull( relationinfo.get("sourceorgid") )%>">
  <input type="hidden" name="targetorgid" value="<%=JspHelper.filterNull( relationinfo.get("targetorgid") )%>">
  <custom:hidden name="userinfo" property="orgid" changedName="ownerorgid" scope="session" />
  <input type="hidden" name="relationtype1" value="<%=JspHelper.filterNull( pageContext.getAttribute("relationtype1") )%>">
  <input type="hidden" name="IsExternal" value="<%=JspHelper.filterNull(IsExternal)%>">
  <input type="hidden" name="RelationType" value="<%=JspHelper.filterNull(RelationType)%>">
  <custom:hidden property="isnew" />


  <table border=0 cellpadding=0 cellspacing=0 width="100%">
  <tr>
    <td valign=top>
      <table border=0 cellpadding=1 cellspacing=0 width="100%">
        <tbody>
        <tr>
          <td bgcolor=#000000 style="PADDING-BOTTOM: 1px; PADDING-LEFT: 1px; PADDING-RIGHT: 1px; PADDING-TOP: 0px">
            <table bgcolor=#000000 border=0 cellpadding=0 cellspacing=0 width="100%">
              <tr>
                <td  bgcolor=#ffffff style="PADDING-BOTTOM: 3px; PADDING-LEFT: 3px; PADDING-RIGHT: 3px; PADDING-TOP: 3px" valign="top">
                  <div id=div2 style="HEIGHT: 415px; OVERFLOW: auto">
                    <table border="1" cellspacing="0" bordercolorlight="#999999" bordercolordark="#FFFFFF" align="center" width="100%" cellpadding="1">
                      <% if(!"view".equalsIgnoreCase((String)session.getAttribute("displayflag"))) {%>
                      <tr>
                        <td colspan="4" class="td_right" height="18">                        
                          <a onclick="page_done()"><custom:button type="2" label="L_Save" imgsrc="save_btn.gif" border="0" /></a>
                        </td>
                      </tr>
                      <% } %>
        <tr>
          <td  class="td-text" width="90"><%= label.getLabelName("L_SourceCompanyName") + label.getLabelName("L_Colon") %></td>
<%--          <td colspan="3">&nbsp;<%=JspHelper.filterNull( relationinfo.get("sourceorgname") )%></td>--%>
          <td colspan="3">&nbsp;
              <%if (!IsEdit.equals("Y") && (!"view".equalsIgnoreCase((String)session.getAttribute("displayflag"))) ) {%>
              <input type="text" name="sourceorgcode" value="<custom:write name="relationinfo" property="sourceorgcode" />" onchange="changeOrg('<%=JspHelper.filterNull(IsExternal)%>',1,this.value);"  size="10">
              <%} else { %>
               <input type="text" name="sourceorgcode" value="<custom:write name="relationinfo" property="sourceorgcode" />" size="10" readonly >
              <% } %>
	            <%if (!IsEdit.equals("Y")  ) {%>
              <a onclick="poporg('<%=JspHelper.filterNull(IsExternal)%>',1)"><custom:button type="3" label="L_Asterisk" imgsrc="flash.gif" border="0"/></a>
              <%}%>
              <input type="text" name="sourceorgname" value="<custom:write name="relationinfo" property="sourceorgname"/>" size="25" readonly >
        </td>
        </tr>
        <tr>
          <td  class="need" width="90"><%= label.getLabelName("L_TargetCompanyName") + label.getLabelName("L_Colon") %></td>
<%--          <td>&nbsp;<%=JspHelper.filterNull( relationinfo.get("targetorgname") )%></td>--%>
          <td>&nbsp;
            <%if (!IsEdit.equals("Y") && (!"view".equalsIgnoreCase((String)session.getAttribute("displayflag"))) ) {%>
            <input type="text" name="targetorgcode" value="<custom:write name="relationinfo" property="targetorgcode"/>" onchange="changeOrg('<%=JspHelper.filterNull(IsExternal)%>',2,this.value);" size="10">
             <%} else {%>
             <input type="text" name="targetorgcode" value="<custom:write name="relationinfo" property="targetorgcode"/>" size="10" readonly>
	           <% } %>
	            <%if (!IsEdit.equals("Y")  ) {%>
              <a onclick="poporg('<%=JspHelper.filterNull(IsExternal)%>',2)"><custom:button type="3" label="L_Asterisk" imgsrc="flash.gif" border="0"/></a>
              <%}%>
              <input type="text" name="targetorgname" value="<custom:write name="relationinfo" property="targetorgname"/>" size="25" readonly >
          </td>
          <td class="td-text"><%= label.getLabelName("L_RelationType") + label.getLabelName("L_Colon") %></td>
<%--          <td >&nbsp;<%=JspHelper.filterNull( relationinfo.get("globalpcname") )%></td>--%>
          <td >&nbsp;
               <%if (!IsEdit.equals("Y")  ) {%>
												<%if (RelationType.equals("11")) {%>
													<custom:selectdic name="relationinfo" property="globalpccode" dictType="GlobalPCCode" valueCriteria="11" disabled="true" />
													<custom:hidden name="relationinfo" property="globalpccode" value="11" />
												<%} else if (RelationType.equals("1")) {%>
													<custom:selectdic name="relationinfo" property="globalpccode" dictType="GlobalPCCode" valueCriteria="1" disabled="true" />
													<custom:hidden name="relationinfo" property="globalpccode" value="1" />
												<% } else { %>
													<custom:selectdic name="relationinfo" property="globalpccode" dictType="GlobalPCCode" valueCriteria="min-98"/>
												<% } %>
							<% } else { %>
							          <%if (RelationType.equals("11")) {%>
													<custom:selectdic name="relationinfo" property="globalpccode" dictType="GlobalPCCode" valueCriteria="11" disabled="true" />
													<custom:hidden name="relationinfo" property="globalpccode" value="11" />
												<%} else if (RelationType.equals("1")) {%>
													<custom:selectdic name="relationinfo" property="globalpccode" dictType="GlobalPCCode" valueCriteria="1" disabled="true"/>
													<custom:hidden name="relationinfo" property="globalpccode" value="1" />
												<% } else { %>
													<custom:selectdic name="relationinfo" property="globalpccode" dictType="GlobalPCCode" valueCriteria="min-98" disabled="true"/>
												<% } %>
							<% } %>
          </td>
          <custom:hidden name="relationinfo" property="onceflag"/></td>
        </tr>
        <tr>
           <td class="td-text" width="110"><%= label.getLabelName("L_isTempCustomer") + label.getLabelName("L_Colon") %></td>
          <td >&nbsp;<custom:checkbox property="onceflag1" onchange="javascript:change_onceflag(1);" styleClass="normalradio"/>
          <td class="td-text" ><%= label.getLabelName("L_DeliveryWH") + label.getLabelName("L_Colon") %></td>
          <td>&nbsp;<custom:select optionsName="allorgwarehouses" optionValueKey="warehouseid" optionInnerTextKey="warehousename"  name="relationinfo" property="warehouseid" defaultValue="-----"/></td>
        </tr>
        <tr>
          <td class="need"><%= label.getLabelName("L_BusinessArea") + label.getLabelName("L_Colon") %></td>
          <td >&nbsp;<custom:select optionsName="allbusiarea" optionValueKey="areaid" optionInnerTextKey="areaname" command="notnull" module="ERM" label="L_BusinessArea" defaultValueCost="" defaultValue="-----" name="relationinfo" property="areaid"/></td>
          <td class="need"><%= label.getLabelName("L_Sales") + label.getLabelName("L_Colon") %></td>
          <td>&nbsp;<custom:select optionsName="allsales" optionValueKey="contactid" optionInnerTextKey="contactname" defaultValue="------" name="relationinfo" property="salesrepid" command="notnull" module="ERM" label="L_Sales"/></td>
        </tr>
        <tr>
          <td class="need"><%= label.getLabelName("L_Group") + label.getLabelName("L_Colon") %></td>
          <%
            Integer entity = (Integer) relationinfo.get("orgrelationdetailid");
            if (entity == null) entity=new Integer(-1);
            HashMap hash=new HashMap();
              hash.put("orgid",pageContext.getAttribute("orgid"));
              hash.put("globalpccode",pageContext.getAttribute("globalpccode"));
              hash.put("languagecode",session.getAttribute("languagecode"));
              hash.put("entityid",entity);
            session.setAttribute("criteria",hash);
          %>
          <td>&nbsp;<custom:select optionsName="allorggroup" optionValueKey="orggroupid" optionInnerTextKey="groupname"
                    name="relationinfo" command="notnull" module="ERM" label="L_Group" defaultValueCost=""
                    defaultValue="-----" property="orggroupid" dmName="mdconfig"  />
          </td>
          <td class="td-text"><%= label.getLabelName("L_CreditLimit") + label.getLabelName("L_Colon") %></td>
          <td>&nbsp;<custom:text name="relationinfo" property="creditlimit" dataType="double" dataFormatName="amountformat" size="8" module="ERM" label="L_CreditLimit"/></td>
        </tr>
        <tr>
          <td class="td-text"><%= label.getLabelName("L_CreditLevel") + label.getLabelName("L_Colon") %></td>
          <td >&nbsp;<custom:select optionsName="allcreditlevel" optionValueKey="creditlevelcode" optionInnerTextKey="creditlevelcode" name="relationinfo" property="creditlevelcode"/></td>
          <td class="td-text"><%= label.getLabelName("L_CreditPeriod(Day)") + label.getLabelName("L_Colon") %></td>
          <td>&nbsp;<custom:text name="relationinfo" property="creditdays" command="notnegative" dataType="double" size="8" module="ERM" label="L_CreditLimit"/></td>
        </tr>
        <tr>
          <td class="td-text"><%= label.getLabelName("L_CreditEffectDate") + label.getLabelName("L_Colon") %></td>
          <td>&nbsp;<custom:text name="relationinfo" property="crediteffectdate" size="18" label="L_CreditEffectDate" dataType="date" dataFormatName="dateformat" module="ERM"/>
            <a onclick="javascript:c.show(this,'frm.crediteffectdate','<%=JspHelper.filterNull( session.getAttribute("dateformat") )%>')"><custom:button type="3" label="L_Asterisk" imgsrc="Time.gif" border="0"/></a>
          </td>
          <td class="td-text"><%= label.getLabelName("L_CreditExpireDate") + label.getLabelName("L_Colon") %></td>
          <td>&nbsp;<custom:text name="relationinfo" property="creditexpiredate" size="18" label="L_CreditExpireDate" dataType="date" dataFormatName="dateformat" module="ERM"/>
            <a onclick="javascript:c.show(this,'frm.creditexpiredate','<%=JspHelper.filterNull( session.getAttribute("dateformat") )%>')"><custom:button type="3" label="L_Asterisk" imgsrc="Time.gif" border="0"/></a>
          </td>
        </tr>
        <tr>
          <%
            Vector alloeitemtype = new Vector();

            HashMap oeitemtype;
            oeitemtype = new HashMap();
            oeitemtype.put("value","1");
            oeitemtype.put("name",label.getLabelName("L_oeItemType1",false));
            alloeitemtype.add(oeitemtype);
            oeitemtype = new HashMap();
            oeitemtype.put("value","2");
            oeitemtype.put("name",label.getLabelName("L_oeItemType2",false));
            alloeitemtype.add(oeitemtype);

            pageContext.setAttribute("alloeitemtype",alloeitemtype);
          %>
          <td class="need"><%= label.getLabelName("L_OrderItemType") + label.getLabelName("L_Colon") %></td>
          <td>&nbsp;<custom:select optionsName="alloeitemtype" optionValueKey="value" optionInnerTextKey="name" name="relationinfo" property="oeitemtype" command="notnull" module="ERM" label="L_OrderItemType"  defaultValueCost="" defaultValue="-----"/></td>
          <%
            Vector alloeumtype = new Vector();

            HashMap oeiumype;
            oeiumype = new HashMap();
            oeiumype.put("value","1");
            oeiumype.put("name",label.getLabelName("L_oeUmType1",false));
            alloeumtype.add(oeiumype);
            oeiumype = new HashMap();
            oeiumype.put("value","2");
            oeiumype.put("name",label.getLabelName("L_oeUmType2",false));
            alloeumtype.add(oeiumype);

            pageContext.setAttribute("alloeumtype",alloeumtype);
          %>
          <td class="need"><%= label.getLabelName("L_OrderUMType") + label.getLabelName("L_Colon") %></td>
          <td>&nbsp;<custom:select optionsName="alloeumtype" optionValueKey="value" optionInnerTextKey="name" name="relationinfo" property="oeumtype" command="notnull" module="ERM" label="L_OrderUMType"  defaultValueCost="" defaultValue="-----"/></td>
        </tr>
        <tr>
          <td class="td-text"><%= label.getLabelName("L_DefaultOrderType") + label.getLabelName("L_Colon") %></td>
          <td>&nbsp;<custom:select optionsName="allordertype" optionValueKey="ordertypeid" optionInnerTextKey="trantypename" name="relationinfo" defaultValueCost=" "  defaultValue="---------" property="ordertypeid"/></td>
          <td class="need"><%= label.getLabelName("L_PriceMethod") + label.getLabelName("L_Colon") %></td>
          <td>&nbsp;<custom:select optionsName="allpricemethod" optionValueKey="value" optionInnerTextKey="valuename" name="relationinfo" property="pricemethod" command="notnull" module="ERM" label="L_PriceMethod" defaultValueCost=" "  defaultValue="---------"/></td>
        </tr>
        <tr>
          <td class="need"><%= label.getLabelName("L_GLGroup") + label.getLabelName("L_Colon") %></td>
          <td>&nbsp;<custom:select optionsName="allglgroupcode" optionValueKey="valuename" optionInnerTextKey="valuename" name="relationinfo" property="glgroupcode" defaultValue="-------" command="notnull" module="ERM" label="L_GLGroup"/></td>
          <td class="td-text"><%= label.getLabelName("L_ERCode") + label.getLabelName("L_Colon") %></td>
          <td>&nbsp;<custom:text property="ercode" name="relationinfo"/></td>
        </tr>
        <tr>
          <td class="td-text"><%= label.getLabelName("L_CommonCurrency") + label.getLabelName("L_Colon") %></td>
          <td>&nbsp;<custom:select optionsName="allcurrency" optionValueKey="currencycode" optionInnerTextKey="currencyname" name="relationinfo" property="zctcurrencycode"  defaultValueCost=" " defaultValue="-------" module="ERM" label="L_CommonCurrency"  onchange="currencychg();" /></td>
          <td class="td-text"><%= label.getLabelName("L_RateType") + label.getLabelName("L_Colon") %></td>
          <td>&nbsp;<custom:select optionsName="allratetype" optionValueKey="value" optionInnerTextKey="valuename" onchange="javascript:changeratetype();" name="relationinfo" property="ratetype"  defaultValueCost=" " defaultValue="-------" module="ERM" label="L_RateType"/>&nbsp;&nbsp;<%= label.getLabelName("L_ZCTCommonRate") + label.getLabelName("L_Colon") %>
          <custom:text dataType="number" dataFormatName="exchangerateformat" name="relationinfo"  property="zctrate" size="10" command="notnull" module="ERM" label="L_ZCTCommonRate" /><span id="ratespan" style="display:inline;" class="red">*</span></td>
        </tr>
        <tr>
          <td class="td-text"><%= label.getLabelName("L_ABC") + label.getLabelName("L_Colon") %></td>
          <td >&nbsp;<custom:text name="relationinfo" property="abccode" size="18"/></td>
          <td class="td-text"><%= label.getLabelName("L_ARBalance") + label.getLabelName("L_Colon") %></td>
          <td >&nbsp;<custom:write name="relationinfo" property="arapamount" nbsp="true" dataType="number" dataFormatName="amountviewformat"/></td>
        </tr>
        <tr>
          <td class="need"><%= label.getLabelName("L_TaxGroup") + label.getLabelName("L_Colon") %></td>
          <td>&nbsp;<custom:select  name="relationinfo" property="taxgroupcode" optionsName="allorgtaxgroups" optionValueKey="taxgroupcode" command="notnull" optionInnerTextKey="taxgroupname" defaultValue="----" defaultValueCost="" module="ERM" label="L_TaxGroup"/></td>
          
		  <td class="td-text"><%= label.getLabelName("L_Department") + label.getLabelName("L_Colon") %></td>
          <td><custom:select optionsName="alldepartment" optionValueKey="deptid"  optionInnerTextKey="deptname"  name="relationinfo" property="deptid" defaultValue="--------"  module="ERM" label="L_Department"/></td>
        </tr>
        <tr>
		    <td class="td-text"><%= label.getLabelName("L_Status") + label.getLabelName("L_Colon") %></td>
		    <td>&nbsp;<custom:select optionsName="allstatus" optionValueKey="value" optionInnerTextKey="valuename" name="relationinfo" property="status" /></td>
		    <td colspan="2">&nbsp;</td>
		</tr>	
</table>
                  </div>
                </td>
              </tr>
            </table>
          </td>
        </tr>
        </tbody>
      </table>
    </td>
  </tr>

</table>
</form>
</table>
<script>
change_onceflag();
<% if(!"view".equalsIgnoreCase((String)session.getAttribute("displayflag"))) {%>
changeratetype();
<% } %>
</script>
</body>
</html>


